package com.example.shop.user.dto;

import com.example.shop.goods.dto.GoodsBrowseInfo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;
import java.time.LocalDateTime;

@Data
@AllArgsConstructor
@NoArgsConstructor
//@Document(indexName = "user-browsing-history",shards = 2,refreshInterval = "300s")
public class BrowsingHistory extends GoodsBrowseInfo  implements Serializable {
    @Field(type = FieldType.Date,format = DateFormat.custom,pattern = "yyyy-MM-dd HH:mm:ss")
    protected LocalDateTime browseDate;

    @Override
    public String toString() {
        return "BrowsingHistory{" +
                super.toString() +
                "browseDate=" + browseDate +
                '}';
    }
}
